//
// Created by Arikes on 9/16/21.
//
#include "ReflectFactory.h"
#include "CFactory1.h"
#include "CFactory2.h"

void CReflectFactory::registeClass(std::string classname,createFunc func){
    classMap_.insert(std::make_pair(classname,func));
}

void* CReflectFactory::getClassByName(std::string classname){
    auto itor = classMap_.find(classname);
    if (itor != classMap_.end())
        return classMap_.find(classname)->second();
    return nullptr;
}